<template>
	<jyf-parser class="web-view" :html="info.content" :tag-style="tagStyle"
		:style="{width: windowW + 'px', height: windowH + 'px'}"></jyf-parser>
</template>

<script>
	import {
		getIllnessInfo
	} from "@/api/summer.js"
	import parser from "@/components/jyf-parser/jyf-parser";
	export default {
		components: {
			"jyf-parser": parser
		},
		data() {
			return {
				windowH: 0,
				windowW: 0,
				tagStyle: {
					img: 'width:100%;display:block;',
					table: 'width:100%',
					video: 'width:100%'
				},
				info: {}
			}
		},
		onLoad(option) {
			console.log(option);
			let vrId = option.id
			this.getVrInfos(vrId)
			try {
				const res = uni.getSystemInfoSync();
				this.windowW = res.windowWidth;
				this.windowH = res.windowHeight;
			} catch (e) {
				// error
			}
		},

		methods: {
			getVrInfos(vrId) {
				this.m_show("加载中");
				getIllnessInfo(vrId).then(res => {
					console.log(res);
					this.info = res.data;
					uni.setNavigationBarTitle({
						title: this.info.title
					})
					this.m_hide();
				})
			}
		}
	}
</script>